import http from './http'

//登陆
export const login = params => {
    return http.post('/login',params)
}

export const register = params => {
    return http.post('/createUser', params)
}

export const getInfo = params => {
    return http.get('/info', params)
}

export const findArticleType = params => {
    return http.get('/findArticleType', params)
}

export const addArticleType = params => {
    return http.post('/addArticleType', params)
}

export const deleteArticleType = params => {
    return http.delete(`/deleteArticleType/${params.id}`)
}

export const editArticleType = params => {
    return http.post('/editArticleType', params)
}

export const findAllArticle = params => {
    return http.post('/findArticle', params)
}
export const addArticle = params => {
    return http.post('/addArticle', params)
}

export const findArticle = params => {
    return http.get(`/findArticle/${params.id}`)
}

export const editArticle = params => {
    return http.post('/editArticle', params)
}

export const removeArticle = params => {
    return http.delete(`/removeArticle/${params.id}`)
}

export const findComment = (val) => {
    return http.post('/comment', val)
}

export const addTools = params => {
    return http.post('/addTools', params)
}

export const updateTools = params => {
    return http.post('/updateTools', params)
}

export const findTools = params => {
    return http.get('/findTools', params)
} 

//上传文件
export const uploadFile = params => {
    return http.post('/upload', params)
}